package gms.topology;

import java.util.Dictionary;
import java.util.Hashtable;
import java.util.Enumeration;

/**
 * Created by IntelliJ IDEA.
 * User: Anton Dunaev
 * Date: 03.09.2007
 * Time: 18:38:13
 */
public class Topology
{
    public Dictionary<Long, Node> nodes;
    public Dictionary<Long, Line> lines;

    public Topology()
    {
        nodes = new Hashtable<Long, Node>();
        lines = new Hashtable<Long, Line>();
    }

    public void reset()
    {
        Enumeration<Node> nodes_enum = nodes.elements();
        while( nodes_enum.hasMoreElements() )
        {
            Node node;
            if( (node = nodes_enum.nextElement()) instanceof CalcNode )
                ((CalcNode)node).reset();
        }
        Enumeration<Line> lines_enum = lines.elements();
        while( lines_enum.hasMoreElements() )
        {
            lines_enum.nextElement().reset();
        }
    }
}
